# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor: Jaroslav Lichtblau <svetlemodry@archlinux.org>
# Contributor: dhead666 <myfoolishgames@gmail.com>

pkgname=tinyxml2
pkgver=9.0.0
pkgrel=2
pkgdesc='Simple XML parser made for easy integration'
arch=('loong64' 'x86_64')
url='https://github.com/leethomason/tinyxml2'
license=('custom:zlib')
depends=('glibc' 'gcc-libs')
makedepends=('cmake')
source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
sha256sums=('cc2f1417c308b1f6acc54f88eb70771a0bf65f76282ce5c40e54cfe52952702c')

build() {
  cmake \
    -B build \
    -S "$pkgname-$pkgver" \
    -D CMAKE_INSTALL_PREFIX=/usr \
    -D tinyxml2_SHARED_LIBS=ON

  cmake --build build
}

check() {
  ctest --test-dir build --output-on-failure
}

package() {
  DESTDIR="$pkgdir" cmake --install build

  # license
  install -vDm644 "$pkgname-$pkgver/LICENSE.txt" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

# vim: ts=2 sw=2 et:
